//
//  KuaiCollectionViewLayout.m
//  K8彩票
//
//  Created by zhoubo on 2017/6/9.
//  Copyright © 2017年 zhoubo. All rights reserved.
//

#import "KuaiCollectionViewLayout.h"

@implementation KuaiCollectionViewLayout

-(void)prepareLayout
{
    // 这个方法调用了两次®®®®®®
//    NSLog(@"-----%f",self.collectionView.bounds.size.width);
    
    CGFloat swidth = [UIScreen mainScreen].bounds.size.width - 80;

    CGFloat margin = 10;
    
    if (swidth<=240) {
        margin = 5;
    }
    
    CGFloat width = swidth/4 - margin;
    
//    //    //设置headview的size
//    self.headerReferenceSize = CGSizeMake( [UIScreen mainScreen].bounds.size.width, 50);
    
    self.itemSize = CGSizeMake(width, width);
    self.minimumLineSpacing=margin;
    self.minimumInteritemSpacing = margin;
    self.collectionView.showsVerticalScrollIndicator = false;
    
    //    //设置fotter的size
    self.footerReferenceSize = CGSizeMake( [UIScreen mainScreen].bounds.size.width - 80, 200);
    
    
    
}

@end
